{% set clazz = "rewards"; %}
{% set title = "推广奖励积分明细"; %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" href="{{ '/static/css/promoter.css'|version }}" />
{% endblock %}
{% block content %}
    {% if !nested %}
      <header class="bar bar-header">
        {{ macro.back() }}
        <h1>{{ title }}</h1>
      </header>
    {% endif %}
    <section>
      <div class="filter">
        <div class="tabs compact" data-tabs="true">
          <a href="#register" class="item active">注册与绑定</a>
          <a href="#activity" class="item">用户活跃行为</a>
          <a href="#placeorder" class="item">用户下单</a>
        </div>
      </div>
      <div class="tab-content">
        <div id="register" class="tabpane active">
          {% if listA.list.length %}
            <div class="list">
              <div class="item">
                <div class="avatar">
                  <img src="{{ holder|holder }}" />
                </div>
                <span class="text">类型</span>
                <span class="text">日期</span>
                <span class="text text-right">奖励积分</span>
              </div>
              {% for item in listA.list %}
                <div class="item">
                  <div class="avatar">
                    <img src="{{ item.headImg|figure }}" class="figure" data-social-id="{{ item.sourceAccountId }}" />
                  </div>
                  <span class="text">{{ item.businessName }}</span>
                  <span class="text">{{ item.optTime|date('Y-m-d') }}</span>
                  <span class="text text-right">{{ item.optType|promoterAction }}{{ item.optIntegralNum|promoterIntegral }}</span>
                </div>
              {% endfor %}
            </div>
          {% else %}
            <div class="plate">
              <div class="draw">
                <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
                <h4 class="title">还没有您推广的用户</h4>
              </div>
            </div>
          {% endif %}
        </div>
        <div id="activity" class="tabpane">
          {% if listB.list.length %}
            <div class="list">
              <div class="item">
                <div class="avatar">
                  <img src="{{ holder|holder }}" />
                </div>
                <span class="text">活跃行为</span>
                <span class="text">日期</span>
                <span class="text text-right">奖励积分</span>
              </div>
              {% for item in listB.list %}
                <div class="item">
                  <div class="avatar">
                    <img src="{{ item.headImg|figure }}" class="figure" data-social-id="{{ item.sourceAccountId }}" />
                  </div>
                  <span class="text">{{ item.businessName }}</span>
                  <span class="text">{{ item.optTime|date('Y-m-d') }}</span>
                  <span class="text text-right">{{ item.optType|promoterAction }}{{ item.optIntegralNum|promoterIntegral }}</span>
                </div>
              {% endfor %}
            </div>
          {% else %}
            <div class="plate">
              <div class="draw">
                <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
                <h4 class="title">您推广的用户还没有活跃行为</h4>
              </div>
            </div>
          {% endif %}
        </div>
        <div id="placeorder" class="tabpane">
          {% if listC.list.length %}
            <div class="list">
              <div class="item">
                <div class="avatar">
                  <img src="{{ holder|holder }}" />
                </div>
                <span class="text">订单金额</span>
                <span class="text">日期</span>
                <span class="text text-right">奖励积分</span>
              </div>
              {% for item in listC.list %}
                <div class="item">
                  <div class="avatar">
                    <img src="{{ item.headImg|figure }}" class="figure" data-social-id="{{ item.sourceAccountId }}" />
                  </div>
                  <span class="text">{{ item.businessName }}<em>{{ item.cardinal|currency }}</em></span>
                  <span class="text">{{ item.optTime|date('Y-m-d') }}</span>
                  <span class="text text-right">{{ item.optType|promoterAction }}{{ item.optIntegralNum|promoterIntegral }}</span>
                </div>
              {% endfor %}
            </div>
          {% else %}
            <div class="plate">
              <div class="draw">
                <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
                <h4 class="title">您推广的用户还没有进行消费</h4>
              </div>
            </div>
          {% endif %}
        </div>
      </div>
    </section>
  {% raw %}
    <script id="templ" type="text/swig-template">
      {% for item in list %}
        <div class="item">
          <div class="avatar">
            <img src="{{ item.headImg|figure }}" class="figure" data-social-id="{{ item.sourceAccountId }}" />
          </div>
          {% if item.integralType == 'XD' %}
            <span class="text">{{ item.businessName }}<em>{{ item.cardinal|currency }}</em></span>
          {% else %}
            <span class="text">{{ item.businessName }}</span>
          {% endif %}
          <span class="text">{{ item.optTime|date('Y-m-d') }}</span>
          <span class="text text-right">{{ item.optType|promoterAction }}{{ item.optIntegralNum|promoterIntegral }}</span>
        </div>
      {% endfor %}
    </script>
  {% endraw %}
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/promoter.js'|version }}"></script>
{% endblock %}